#!/usr/bin/env python
#
# about.py
# Copyright (C) Master Kernel 2008 <master.kernel.contact@gmail.com>
#
# about.py is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# jumper.py is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.

from KernelCheck.constants import *

# Import needed modules
try:
    import sys
    import gtk
    import pygtk
    pygtk.require("2.0")
except:
    sys.exit(1)


# Name the program
APPNAME="About KernelCheck"
APPVERSION="1.2.5 Experimental"

def destroy(widget):
    gtk.main_quit()

def run():
    # Initialize the program in Gnome's memory
    x = gtk.AboutDialog()
    x.set_name("About KernelCheck")
    x.set_version("1.2.5 Experimental")
    x.set_copyright("Team KernelCheck 2009")
    license_file = open(KCHECK_PREFIX + 'License.txt', 'r') # Open a file for read
    license_text =  license_file.read() # Read in the contents of the file to var
    license_file.close() # Close the file
    x.set_license(str(license_text))
    x.set_website('http://kcheck.sourceforge.net')
    x.set_website_label('http://kcheck.sourceforge.net')
    x.set_authors(['master_kernel', 'deepspring'])
    x.set_documenters(['master_kernel', 'deepspring'])
    x.set_artists(['aaaatoine', 'dirk.r.gently', 'master_kernel'])
    logo = gtk.gdk.pixbuf_new_from_file(KCHECK_PIXMAPS + 'kernelcheck.svg')
    x.set_logo(logo)
    x.set_program_name('KernelCheck')

    x.connect('destroy', destroy)
    x.connect("response", lambda d, r: d.destroy())
    x.show()


    gtk.main()


